<div class="page-content">
    <div class="row">
        <div class="col-xs-12">
            <table class="table table-striped table-bordered table-hover">
                <thead>
                <tr>
                    <th>名称</th>
                    <th>创建时间</th>
                    <th>浏览人数</th>
                    <th>喜欢人数</th>
                    <th>开始时间</th>
                    <th>结束时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody id="user_list">
                #foreach ($item in ${proj})
                <tr>
                    <td> $item.projectName</td>
                    <td> $date.format('yyyy-MM-dd HH:mm', $item.projectCreatetime) </td>
                    <td> $item.projectViewcnt</td>
                    <td> $item.projectLikecnt</td>
                    <td> $date.format('yyyy-MM-dd HH:mm', $item.projectBegintime)</td>
                    <td> $date.format('yyyy-MM-dd HH:mm', $item.projectEndtime)</td>
                    <td> <a class="red" href="javascrip:void(0)" onclick= "removeFromIndex(${item.projectId})" title="移除">
                        <i class="ace-icon fa fa-trash-o bigger-130"></i>
                    </a></td>
                </tr>
                #end
                </tbody>
            </table>
        </div>
        <!-- /.span -->
    </div>
    <!-- /.row -->
</div>

<script>
    function removeFromIndex(Id) {
        confirm('确认删除?', function () {
            $.ajax({
                type: "GET",
                url: './project/removeFromIndex',
                data: {projectId: Id},
                success: function (data) {
                    if (data.resultCode == 0) {
                        succ('删除成功！');
                        delay(function () {
                            load(basePath+"/index/project");}, 1000);
                    } else {
                        error('删除失败！');
                    }
                },
                dataType: 'JSON'
            });
        });
    }
</script>